using FlowCanvas;
using FlowCanvas.Nodes;
using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.AI.Node
{
    [Category("Ggame/Liberty")]
    public class RemoveBTNpc : CallableActionNodeBase
    {
        private void Invoke(int uniqueId)
        {
            BlueprintUtils.LibertyManager.AIManager.RemoveNpc(uniqueId);
        }
        
        protected override void OnRegisterPorts(FlowNode node)
        {
            var p1 = node.AddValueInput<int>("uniqueId");
            var o = node.AddFlowOutput("Out");
            node.AddFlowInput("In", (f) =>
            {
                Invoke(p1.value);
                o.Call(f);
            });
        }
    }
}